package cs8;

import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

public class LeanComparable {
	public static void main(String[] args) {
		Set<Dog2> set = new TreeSet<Dog2>();
		set.add(new Dog2("dog1","zhangsan"));
		set.add(new Dog2("dog2","zhangsan"));
		set.add(new Dog2("dog3","zhangsan"));
		set.add(new Dog2("dog2","zhangsan"));
		set.add(new Dog2("dog1","zhangsan"));
		set.add(new Dog2("dog","zhangsan"));
		
		Iterator<Dog2> it=set.iterator();
		while (it.hasNext()){
			it.next().print();
		}

	}

}
